home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group94a.txt
/
000083_icon-group-sender _Tue Apr 19 06:40:37 1994.msg
< prev
next >
Wrap
Internet Message Format
|
1994-08-19
|
1KB
Received: by cheltenham.cs.arizona.edu; Tue, 19 Apr 1994 09:23:09 MST
Via: uk.ac.edinburgh.festival; Tue, 19 Apr 1994 14:03:19 +0100
Date: 19 Apr 94 14:03:10 BST
From: R J Hare <rjhare@festival.ed.ac.uk>
Subject: random numbers
To: icon-group@cs.arizona.edu
Organisation: Edinburgh University Computing Service
Message-Id: <9404191403.aa04644@uk.ac.ed.festival>
Status: R
Errors-To: icon-group-errors@cs.arizona.edu
I have a program in which I have an integer which marks the upper end of a
range from which I wish to randomly select a value. I am using:
i:=?range
so, if I have previously set range to (say) 13, I should get i in the range
1..13. In fact, I am getting i equals 1 or 3, ie: ? is apparently treating
range as a 2 character string and returning randomly the value of the 1st or
2nd character in the string. Is this behaviour correct?
If I do something like:
i:=?integer(range)
all is well.
I am a little puzzled by this behaviour and would be grateful if someone
could explain it...
Thanks.
RogerHare